import 'package:flutter/material.dart';
import 'package:flutter_widget_from_html_core/flutter_widget_from_html_core.dart';
import 'package:get/get.dart';
import 'package:yysk_app/model/common_model/notice_list_model.dart';
import 'package:yysk_app/model/tab_model.dart';
import 'package:yysk_app/pages/nft_pages/home_pages/bulk_sales_and_cancellation_of_sales/bulk_sales_and_cancellation_of_sales_page.dart';
import 'package:yysk_app/pages/nft_pages/home_pages/checkEligibility/checkEligibility_page.dart';
import 'package:yysk_app/pages/nft_pages/home_pages/my_collection_list/my_collection_list_page.dart';
import 'package:yysk_app/pages/nft_pages/home_pages/news_detail/news_detail_page.dart';
import 'package:yysk_app/pages/nft_pages/market_pages/market_collection_buy/market_collection_buy_page.dart';
import 'package:yysk_app/pages/nft_pages/market_pages/market_collection_detail/market_collection_detail_controller.dart';
import 'package:yysk_app/pages/nft_pages/market_pages/market_transaction_dynamics/market_transaction_dynamics_page.dart';
import 'package:yysk_app/utils/colors.dart';
import 'package:yysk_app/utils/helper.dart';
import 'package:yysk_app/widget/custom_app_bar2.dart';
import 'package:yysk_app/widget/empty_widget.dart';
import 'package:yysk_app/widget/image_asset_widget.dart';
import 'package:yysk_app/widget/lazy_network_image.dart';
import 'package:yysk_app/widget/tab_widget.dart';
import 'package:oktoast/oktoast.dart';

class MarketCollectionDetailPage
    extends GetView<MarketCollectionDetailController> {
  static const String path = '/MarketCollectionDetail';

  const MarketCollectionDetailPage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      resizeToAvoidBottomInset: false,
      backgroundColor: AppColors.backgroundColorBlack,
      body: SafeArea(
        top: false,
        child: Obx(() {
          // final dateil = controller.firstDetail.value;
          double top = MediaQuery.of(context).padding.top;
          return Column(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: [
              Expanded(
                child: ListView(
                  padding: EdgeInsets.fromLTRB(0.px, 0.px, 0.px, 24.px),
                  children: [
                    LayoutBuilder(
                      builder: (
                        BuildContext context,
                        BoxConstraints constraints,
                      ) {
                        return _header(
                          context: context,
                          top: top,
                          controller: controller,
                        );
                      },
                    ),
                    // SizedBox(height: 20.px),
                    _bodySale(context, controller),
                    Padding(
                      padding: EdgeInsets.only(left: 14.px, right: 14.px),
                      child: Column(
                        children: [
                          _collectTab(context: context, controller: controller),
                             SizedBox(
                    width: context.width,
                    height: 101.px,
                    child: Center(
                      child: Image.asset(
                        'static/images/bsn.png',
                        width: 138.px,
                        height: 23.px,
                        fit: BoxFit.fill,
                      ),
                    ),
                  )
                        ],
                      ),
                    ),
                  ],
                ),
              ),

              _bottomItem(context: context),
            ],
          );
        }),
      ),
    );
  }

  _bodySale(BuildContext context, MarketCollectionDetailController controller) {
    final marketDetail = controller.marketDetail.value;
    return Center(
      child: Container(
        width: 335.px,
        padding: EdgeInsets.fromLTRB(0.px, 10.px, 0.px, 0.px),
        margin: EdgeInsets.only(bottom: 50.px),
        child: Column(
          children: [
            SizedBox(height: 10.px),
            Row(
              children: [
                Text(
                  '孵化信息',
                  style: TextStyle(
                    color: AppColors.backgroundColor,
                    fontSize: 18.px,
                  ),
                ),
              ],
            ),
            SizedBox(height: 24.px),
             Container(
              width: context.width,
              padding: EdgeInsets.only(bottom: 14.px, top: 14.px),
              decoration: BoxDecoration(
                borderRadius: BorderRadius.circular(8.px),
                border: Border.all(
                  width: 1.px,
                  color: Color.fromRGBO(59, 62, 69, 1),
                ),
              ),
              child: Row(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                crossAxisAlignment: CrossAxisAlignment.center,
                children: [
                  SizedBox(
                    width: 84.px,

                    child: Column(
                      mainAxisAlignment: MainAxisAlignment.center,
                      crossAxisAlignment: CrossAxisAlignment.center,
                      children: [
                       
                    
                        Text(
                          '${marketDetail?.incubationPrice ?? 0}',
                          style: TextStyle(
                            color: AppColors.fontColor,
                            fontSize: 14.px,
                            overflow: TextOverflow.ellipsis,
                          ),
                        ),
                            SizedBox(height: 8.px),
                         Text(
                          '起孵价格',
                          style: TextStyle(
                            color: AppColors.backgroundColorGrey,
                            fontSize: 14.px,
                            overflow: TextOverflow.ellipsis,
                          ),
                        ),
                      ],
                    ),
                  ),
                  Container(
                    width: 1,
                    height: 20.px,
                    color: Color.fromRGBO(59, 62, 69, 1),
                  ),
                  SizedBox(
                    width: 84.px,
                    child: Column(
                      mainAxisAlignment: MainAxisAlignment.center,
                      crossAxisAlignment: CrossAxisAlignment.center,
                      children: [
                      
                  
                        Text(
                          '${marketDetail?.incubationLimitPrice ?? 0}',
                          style: TextStyle(
                            color: AppColors.fontColor,
                            fontSize: 14.px,
                            overflow: TextOverflow.ellipsis,
                          ),
                        ),
                              SizedBox(height: 8.px),
                          Text(
                          '孵化上限',
                          style: TextStyle(
                            color: AppColors.backgroundColorGrey,
                            fontSize: 14.px,
                            overflow: TextOverflow.ellipsis,
                          ),
                        ),
                      ],
                    ),
                  ),
                  Container(
                    width: 1,
                    height: 20.px,
                    color: Color.fromRGBO(59, 62, 69, 1),
                  ),
                  SizedBox(
                    width: 84.px,
                    child: Column(
                      mainAxisAlignment: MainAxisAlignment.center,
                      crossAxisAlignment: CrossAxisAlignment.center,
                      children: [
                       
                     
                        Text(
                          '${marketDetail?.dailyIncreaseType == 'PERCENT' ? '±${(num.parse(marketDetail?.dailyIncreasePercent) * 1000000 / 10000)}%' : '±${marketDetail?.dailyIncreasePercent ?? 0}'} ',
                          style: TextStyle(
                            color: AppColors.fontColor,
                            fontSize: 14.px,
                            overflow: TextOverflow.ellipsis,
                          ),
                        ),
                           SizedBox(height: 8.px),
                         Text(
                          '孵化幅度',
                          style: TextStyle(
                            color: AppColors.backgroundColorGrey,
                            fontSize: 14.px,
                            overflow: TextOverflow.ellipsis,
                          ),
                        ),
                      ],
                    ),
                  ),
                  Container(
                    width: 1,
                    height: 20.px,
                    color: Color.fromRGBO(59, 62, 69, 1),
                  ),
                  Expanded(
                    child: SizedBox(
                      width: 84.px,
                      child: Column(
                        mainAxisAlignment: MainAxisAlignment.center,
                        crossAxisAlignment: CrossAxisAlignment.center,
                        children: [
                         
                    
                          Text(
                            '${marketDetail?.incubationCycle ?? 0} 天',
                            style: TextStyle(
                              color: AppColors.fontColor,
                              fontSize: 14.px,
                              overflow: TextOverflow.ellipsis,
                            ),
                          ),
                                SizedBox(height: 8.px),
                           Text(
                            '寄存周期',
                            style: TextStyle(
                              color: AppColors.backgroundColorGrey,
                              fontSize: 14.px,
                              overflow: TextOverflow.ellipsis,
                            ),
                          ),
                        ],
                      ),
                    ),
                  ),
                ],
              ),
            ),
            SizedBox(height: 14.px),
            Row(
              children: [
                Text(
                  '孵化规则',
                  style: TextStyle(
                    color: AppColors.backgroundColor,
                    fontSize: 14.px,
                  ),
                ),
              ],
            ),
            SizedBox(height: 10.px),

            HtmlWidget(
              ''' <div>
                        ${marketDetail?.incubationRule ?? ''}
                        </div>
                        ''',
              textStyle: const TextStyle(color: AppColors.backgroundColorGrey),
              customWidgetBuilder: (element) {
                if (element.localName == 'img') {
                  // consoleLog('String===${element.attributes['src']}');
                  return LazyImage(
                    imageUrl: '${element.attributes['src']}',
                    boxFit: BoxFit.fitWidth,
                    width: context.width,
                    aotuHeight: true,
                  );
                }
                return null;
              },
            ),
          ],
        ),
      ),
    );
  }

  _header({
    required BuildContext context,
    double top = 0,
    required MarketCollectionDetailController controller,
  }) {
    // final detail = controller.firstDetail.value;
    return Obx(
      () => Stack(
        children: [
          SizedBox(
            width: context.width,
            // decoration: BoxDecoration(color: AppColors.fontColorGrey),
            child: Column(
              children: [
                SizedBox(
                  width: context.width,
                  child: ImageAssetWidget(
                    width: 375.px,
                    height: 582.px,
                    imageUrl: 'static/images/bg.png',
                  ),
                ),
              ],
            ),
          ),
          Container(
            width: context.width,
            padding: EdgeInsets.only(top: (400.px)),
            child: Column(
              children: [
                Center(
                  child: ImageAssetWidget(
                    width: 375.px,
                    height: 133.px,
                    fit: BoxFit.cover,
                    imageUrl: 'static/images/bg3.png',
                  ),
                ),
              ],
            ),
          ),
          Container(
            padding: EdgeInsets.only(top: top),
            child: CustomAppBar2(title: '', context: context),
          ),
          Container(
            margin: EdgeInsets.only(top: 140.px),
            child: Center(
              child: LazyImage(
                imageUrl: '${controller.marketDetail.value?.mainImageUrl}',
                width: 200.px,
                height: 200.px,
                boxFit: BoxFit.fitHeight,
                alignment: Alignment.topCenter,
              ),
            ),
          ),
          Positioned(
            left: 0,
            right: 0,
            top: 477.px,
            child: Container(
              width: context.width,
              height: 60.px,

              child: Column(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children: [
                  Text(
                    controller.marketDetail.value?.collectionName ?? '',
                    textAlign: TextAlign.center,
                    style: TextStyle(
                      fontSize: 18.px,
                      color: AppColors.fontColor,
                      overflow: TextOverflow.ellipsis,
                    ),
                  ),
                  SizedBox(height: 10.px),
                  Row(
                    mainAxisAlignment: MainAxisAlignment.center,
                    children: [
                      Container(
                        height: 21.px,
                        clipBehavior: Clip.antiAlias,
                        decoration: BoxDecoration(
                          // color: const Color.fromRGBO(255, 238, 192, 1),
                          borderRadius: BorderRadius.circular(4.px),
                          color: AppColors.startColor,
                          border: Border.all(
                            width: 1.px,
                            color: AppColors.startColor,
                          ),
                        ),
                        margin: EdgeInsets.fromLTRB(12.px, 0, 12.px, 0),
                        padding: EdgeInsets.fromLTRB(0.px, 0, 0.px, 0),
                        child: Center(
                          child: Row(
                            children: [
                              SizedBox(
                                width: 36.px,
                                child: Stack(
                                  children: [
                                    Center(
                                      child: Text(
                                        '限量',
                                        style: TextStyle(
                                          color: Colors.black,
                                          fontSize: 10.px,
                                        ),
                                      ),
                                    ),
                                  ],
                                ),
                              ),

                              Container(
                                padding: EdgeInsets.fromLTRB(3.px, 0, 11.px, 0),
                                height: 22.px,
                                decoration: BoxDecoration(
                                  borderRadius: BorderRadius.only(
                                    topRight: Radius.circular(4.px),
                                    bottomRight: Radius.circular(4.px),
                                  ),
                                  color: AppColors.backgroundColorBlack,
                                ),
                                child: Center(
                                  child: Text(
                                    '${controller.marketDetail.value?.totalIssueCount ?? '0'}',
                                    style: TextStyle(
                                      color: AppColors.startColor,
                                      fontSize: 10.px,
                                    ),
                                  ),
                                ),
                              ),
                            ],
                          ),
                        ),
                      ),

                      Container(
                        height: 21.px,
                        decoration: BoxDecoration(
                          // color: const Color.fromRGBO(255, 238, 192, 1),
                          borderRadius: BorderRadius.circular(4.px),
                          color: AppColors.startColor,
                          border: Border.all(
                            width: 1.px,
                            color: AppColors.startColor,
                          ),
                        ),
                        margin: EdgeInsets.fromLTRB(12.px, 0, 12.px, 0),
                        padding: EdgeInsets.fromLTRB(0.px, 0, 0.px, 0),
                        child: Center(
                          child: Row(
                            children: [
                              SizedBox(
                                width: 36.px,
                                child: Stack(
                                  children: [
                                    Center(
                                      child: Text(
                                        '发行方',
                                        style: TextStyle(
                                          color: Colors.black,
                                          fontSize: 10.px,
                                        ),
                                      ),
                                    ),
                                  ],
                                ),
                              ),
                              Container(
                                padding: EdgeInsets.fromLTRB(3.px, 0, 11.px, 0),
                                height: 22.px,
                                decoration: BoxDecoration(
                                  borderRadius: BorderRadius.only(
                                    topRight: Radius.circular(4.px),
                                    bottomRight: Radius.circular(4.px),
                                  ),
                                  color: AppColors.backgroundColorBlack,
                                ),
                                child: Center(
                                  child: Text(
                                    controller.marketDetail.value?.daoName ??
                                        '',
                                    style: TextStyle(
                                      color: AppColors.startColor,
                                      fontSize: 10.px,
                                    ),
                                  ),
                                ),
                              ),
                            ],
                          ),
                        ),
                      ),
                    ],
                  ),
                ],
              ),
            ),
          ),
        ],
      ),
    );
  }

  _collectTab({
    required BuildContext context,
    required MarketCollectionDetailController controller,
  }) {
    final detail = controller.marketDetail.value;
    return Container(
      width: context.width,
      margin: EdgeInsets.only(bottom: 10.px),
      padding: EdgeInsets.fromLTRB(0.px, 0.px, 0.px, 0.px),
      clipBehavior: Clip.antiAlias,
      decoration: BoxDecoration(),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          Container(
            color: Colors.transparent,
            child: Padding(
              padding: EdgeInsets.fromLTRB(12.px, 0, 12.px, 0),
              child: Column(
                children: [
                  TabWidget(
                    isCurrentFontSize: 18,
                    notCurrentFontSize: 16,
                    tabColor: AppColors.fontColorGreenA9,
                    activeColor: AppColors.fontColor,
                    currentUndelineColorStart: Color.fromRGBO(0, 234, 255, 1),
                    currentUndelineColorEnd: Color.fromRGBO(0, 193, 242, 0.06),
                    currentUndeline: true,
                    tabList: [
                      TabModel(code: 'detail', label: '藏品详情'),
                      TabModel(code: 'ann', label: '相关公告'),
                    ],
                    onChanged: (value) {
                      controller.currentTab.value = value;
                    },
                  ),
                ],
              ),
            ),
          ),
          if (controller.currentTab.value == 'detail')
            Container(
              width: context.width,
              margin: EdgeInsets.only(bottom: 10.px),
              padding: EdgeInsets.fromLTRB(14.px, 14.px, 14.px, 21.px),
              clipBehavior: Clip.antiAlias,
              decoration: BoxDecoration(
                borderRadius: BorderRadius.circular(8.px),
                color: AppColors.backgroundColorGrey2,
                boxShadow: [
                  BoxShadow(
                    color: AppColors.backgroundColorBlack.withAlpha(25),
                    offset: const Offset(0, 14),
                    blurRadius: 24,
                    spreadRadius: 0,
                  ),
                ],
              ),
              child: HtmlWidget(
                ''' <div>
                        ${detail?.collectionDesc ?? '暂无'}
                        </div>
                        ''',
                textStyle: const TextStyle(
                  color: AppColors.backgroundColorGrey,
                ),
                customWidgetBuilder: (element) {
                  if (element.localName == 'img') {
                    // consoleLog('String===${element.attributes['src']}');
                    return LazyImage(
                      imageUrl: '${element.attributes['src']}',
                      boxFit: BoxFit.fitWidth,
                      width: context.width,
                      aotuHeight: true,
                    );
                  }
                  return null;
                },
              ),
            ),
          if (controller.currentTab.value == 'ann')
            SizedBox(
              width: context.width,
              child: Column(
                children: [_buildPlatformList(controller.noticeList, context)],
              ),
            ),
        ],
      ),
    );
  }

  _instructions({
    required BuildContext context,
    required MarketCollectionDetailController controller,
  }) {
    final detail = controller.marketDetail.value;
    return Container(
      width: context.width,
      margin: EdgeInsets.only(bottom: 10.px),
      padding: EdgeInsets.fromLTRB(14.px, 0.px, 14.px, 21.px),
      clipBehavior: Clip.antiAlias,
      decoration: BoxDecoration(
        borderRadius: BorderRadius.circular(8.px),
        color: AppColors.backgroundColorGrey2,
        boxShadow: [
          BoxShadow(
            color: AppColors.backgroundColorBlack.withAlpha(25),
            offset: const Offset(0, 14),
            blurRadius: 24,
            spreadRadius: 0,
          ),
        ],
      ),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          _midwidget(context: context),
          SizedBox(
            width: context.width,
            child: HtmlWidget(
              ''' <div>
                        ${detail?.collectionDesc ?? ''}
                        </div>
                        ''',
              textStyle: const TextStyle(color: AppColors.backgroundColorGrey),
              customWidgetBuilder: (element) {
                if (element.localName == 'img') {
                  // consoleLog('String===${element.attributes['src']}');
                  return LazyImage(
                    imageUrl: '${element.attributes['src']}',
                    boxFit: BoxFit.fitWidth,
                    width: context.width,
                    aotuHeight: true,
                  );
                }
                return null;
              },
            ),
            // Text(
            //   '${detail?.collectionNotice}',
            //   style: TextStyle(fontSize: 12.px, color: AppColors.fontColorGrey),
            // ),
          ),
        ],
      ),
    );
  }

  //中间区域
  _midwidget({required BuildContext context}) {
    return Container(
      width: context.width,
      color: Colors.transparent,
      padding: EdgeInsets.fromLTRB(0, 20.px, 0, 20.px),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.center,
        crossAxisAlignment: CrossAxisAlignment.center,
        children: [
          ImageAssetWidget(
            imageUrl: 'static/images/home/zuizi.png',
            width: 24.px,
            height: 24.px,
          ),
          SizedBox(width: 8.px),
          Text(
            '购买须知',
            style: TextStyle(fontSize: 18.px, color: AppColors.fontColor),
          ),
          SizedBox(width: 8.px),
          ImageAssetWidget(
            imageUrl: 'static/images/home/zuizi.png',
            width: 24.px,
            height: 24.px,
          ),
        ],
      ),
    );
  }

  //中间公告
  Widget _buildPlatformList(List<NoticeListItem> list, BuildContext context) {
    return list.isEmpty
        ? const EmptyWidget()
        : Column(
          children: [
            ...list.map((e) {
              return GestureDetector(
                onTap: () {
                  Get.toNamed(
                    NewsDetailPage.path,
                    arguments: {
                      'id': e.id,
                      'content': e.content,
                      'title': e.title,
                      'labelName': e.labelName,
                      'createTime': e.createTime,
                    },
                  );
                },
                child: Container(
                  padding: EdgeInsets.all(16.px),
                  margin: EdgeInsets.only(bottom: 10.px),
                  width: context.width,
                  decoration: BoxDecoration(
                    color: AppColors.backgroundColorGrey2,
                    borderRadius: BorderRadius.circular(8.px),
                  ),
                  child: Column(
                    mainAxisAlignment: MainAxisAlignment.start,
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: [
                      Row(
                        children: [
                          SizedBox(
                            width: 300.px,
                            child: Text(
                              e.title ?? '',
                              style: TextStyle(
                                color: AppColors.grey100,
                                fontSize: 14.px,
                                fontWeight: FontWeight.w700,
                                overflow: TextOverflow.ellipsis,
                              ),
                            ),
                          ),
                        ],
                      ),
                      SizedBox(height: 8.px),
                      Container(
                        width: context.width,
                        margin: EdgeInsets.fromLTRB(0, 14.px, 0, 14.px),
                        color: AppColors.backgroundColorGrey,
                        height: 1.px,
                      ),
                      Row(
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        children: [
                          Text(
                            '${e.createTime}',
                            maxLines: 2,
                            overflow: TextOverflow.ellipsis,
                            textAlign: TextAlign.left,
                            style: TextStyle(
                              color: AppColors.fontColorGrey,
                              fontSize: 13.px,
                              fontWeight: FontWeight.bold,
                            ),
                          ),
                          Row(
                            children: [
                              Text(
                                '查看详情',
                                style: TextStyle(
                                  color: AppColors.fontColorGrey,
                                  fontSize: 13.px,
                                ),
                              ),
                              SizedBox(width: 4.px),
                              Icon(
                                Icons.chevron_right_outlined,
                                color: AppColors.fontColorGrey,
                                size: 14.px,
                              ),
                            ],
                          ),
                        ],
                      ),
                    ],
                  ),
                ),
              );
            }),
          ],
        );
  }

  //底部
  _bottomItem({required BuildContext context}) {
    final detail = controller.marketDetail.value;
    return Container(
      width: context.width,

      decoration: BoxDecoration(
        color: Color.fromRGBO(13, 14, 18, 1),
        border: Border(
          top: BorderSide(width: 0.5.px, color: Color.fromRGBO(59, 62, 69, 1)),
        ),
      ),
      child: Padding(
        padding: EdgeInsets.only(
          top: 10.px,
          // bottom: MediaQuery.of(context).padding.bottom,
          left: 14.px,
          right: 14.px,
        ),
        child: Column(
          children: [
            Row(
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              crossAxisAlignment: CrossAxisAlignment.center,
              children: [
                Row(
                  crossAxisAlignment: CrossAxisAlignment.center,

                  children: [
                    Text(
                      '今日限价',
                      style: TextStyle(
                        fontSize: 12.px,
                        color: AppColors.backgroundColorBlackE0,
                      ),
                    ),
                    SizedBox(width: 8.px),
                    Row(
                      children: [
                         Text(
                          '￥',
                          style: TextStyle(
                            fontSize: 14.px,
                            color: AppColors.startColor,
                          ),
                        ),
                        Text(
                          '${detail?.totalPriceLimit ?? ''}',
                          style: TextStyle(
                            fontSize: 20.px,
                            color: AppColors.startColor,
                          ),
                        ),
                        Text(
                          '',
                          style: TextStyle(
                            fontSize: 14.px,
                            color: AppColors.startColor,
                          ),
                        ),
                      ],
                    ),
                  ],
                ),
                GestureDetector(
                  onTap: () {
                    // showToast('查看动态逻辑');
                    Get.toNamed(
                      '${MarketTransactionDynamicsPage.path}?id=${detail?.collectionId}',
                      arguments: {
                        'id': {detail?.collectionId},
                      },
                    );
                  },
                  child: Row(
                    children: [
                      Text(
                        '交易动态 >',
                        style: TextStyle(
                          fontSize: 13.px,
                          color: AppColors.backgroundColorGrey,
                        ),
                      ),
                    ],
                  ),
                ),
              ],
            ),
            SizedBox(height: 15.px),
            Row(
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              children: [
                GestureDetector(
                  onTap: () {
                    if (detail?.isOwn != true) {
                      showToast('未持有该藏品');
                    } else {
                      Get.toNamed(
                        '${MyCollectionListPage.path}?id=${detail?.collectionId}',
                        arguments: {
                          'id': '${detail?.collectionId}',
                        },
                      );
                    }
                  },
                  child: Container(
                    width: 169.px,
                    height: 40.px,
                    decoration: BoxDecoration(
                      color: Color.fromRGBO(59, 62, 69, 1),
                      borderRadius: BorderRadius.circular(100),
                    ),
                    child: Center(
                      child: Text(
                        '出售',
                        style: TextStyle(
                          fontSize: 15.px,
                          color: AppColors.backgroundColorBlackE0,
                        ),
                      ),
                    ),
                  ),
                ),
                GestureDetector(
                  onTap: () {
                    Get.toNamed(
                      '${MarketCollectionBuyPage.path}?id=${detail?.collectionId}&canBuyCount=${detail?.canBuyCount ?? 0}&incubationId=${detail?.id}',
                      arguments: {
                        'id': '${detail?.collectionId}',
                        'canBuyCount': detail?.canBuyCount,
                        'incubationId': '${detail?.id}',
                      },
                    );
                  },
                  child: Container(
                    width: 169.px,
                    height: 40.px,
                    decoration: BoxDecoration(
                      color: AppColors.startColor,
                      borderRadius: BorderRadius.circular(100),
                    ),
                    child: Center(
                      child: Text(
                        '立即购买',
                        style: TextStyle(
                          fontSize: 15.px,
                          color: AppColors.backgroundColorBlack,
                          fontWeight: FontWeight.w600,
                        ),
                      ),
                    ),
                  ),
                ),
              ],
            ),
            SizedBox(height: 10.px),
          ],
        ),
      ),
    );
  }
}
